/**
 * PieceViewFactory.java
 * 11/05/2011 12:16:09
 */
package view;

import java.awt.Graphics2D;

import model.pieces.*;
import view.pieces.*;

/**
 * @author walber
 *
 */
public final class PieceViewFactory {

	public static PieceDisplayView createPieceView(Graphics2D g2D, Piece piece) {
		PieceDisplayView pieceView = null;
		if (piece instanceof Wall) {
			pieceView = new WallDisplayView(g2D, (Wall) piece);
		} else if (piece instanceof Box) {
			pieceView = new BoxDisplayView(g2D, (Box) piece);
		} else if (piece instanceof Target) {
			pieceView = new TargetDisplayView(g2D, (Target) piece);
		} else if (piece instanceof Man) {
			pieceView = new ManDisplayView(g2D, (Man) piece);
		}
		return pieceView;
	}
}
